﻿<%@ Page Language="C#" Theme="PAT_Theme" MasterPageFile="~/master/PAT.master" AutoEventWireup="true"  CodeFile="PatTipoDocumentoEdit.aspx.cs" Inherits="PatTipoDocumentoEdit" Title="PatTipoDocumento Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="subHeaderContent" Runat="Server">Pat Tipo Documento - Agregar/Editar</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="IdTipoDocumento" runat="server" DataSourceID="PatTipoDocumentoDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="usercontrols/PatTipoDocumentoFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="usecontrols/PatTipoDocumentoFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>PatTipoDocumento not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Crear" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Actualizar" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:PatTipoDocumentoDataSource ID="PatTipoDocumentoDataSource" runat="server"
			SelectMethod="GetByIdTipoDocumento"
		>
			<Parameters>
				<asp:QueryStringParameter Name="IdTipoDocumento" QueryStringField="IdTipoDocumento" Type="String" />

			</Parameters>
		</data:PatTipoDocumentoDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewPatDocumento1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewPatDocumento1_SelectedIndexChanged"			 			 
			DataSourceID="PatDocumentoDataSource1"
			DataKeyNames="IdDocumento"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_PatDocumento.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="DescripcionDocumento" HeaderText="Descripcion Documento" SortExpression="[DESCRIPCION_DOCUMENTO]" />				
				<data:HyperLinkField HeaderText="Id Tipo Documento" DataNavigateUrlFormatString="PatTipoDocumentoEdit.aspx?IdTipoDocumento={0}" DataNavigateUrlFields="IdTipoDocumento" DataContainer="IdTipoDocumentoSource" DataTextField="DescripcionTipoDocumento" />
				<asp:BoundField DataField="NumeroIniicial" HeaderText="Numero Iniicial" SortExpression="[NUMERO_INIICIAL]" />				
				<asp:BoundField DataField="NumeroFinal" HeaderText="Numero Final" SortExpression="[NUMERO_FINAL]" />				
				<asp:BoundField DataField="UltimoConsecutivoUsado" HeaderText="Ultimo Consecutivo Usado" SortExpression="[ULTIMO_CONSECUTIVO_USADO]" />				
				<asp:BoundField DataField="Activo" HeaderText="Activo" SortExpression="[ACTIVO]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Pat Documento Found! </b>
				<asp:HyperLink runat="server" ID="hypPatDocumento" NavigateUrl="~/aspx/params/PatDocumentoEdit.aspx">Agregar Nuevo </asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:PatDocumentoDataSource ID="PatDocumentoDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:PatDocumentoProperty Name="PatTipoDocumento"/> 
					<%--<data:PatDocumentoProperty Name="IdDocumentoNumeroOrdenPatOrdenTrabajoSegurosCollection_From_PatOrdenTrabajo" />--%>
					<%--<data:PatDocumentoProperty Name="IdDocumentoNumeroOrdenPatOrdenTrabajoGarantiaCollection_From_PatOrdenTrabajo" />--%>
					<%--<data:PatDocumentoProperty Name="PatOrdenTrabajoCollection" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:PatDocumentoFilter  Column="IdTipoDocumento" QueryStringField="IdTipoDocumento" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:PatDocumentoDataSource>		
		
		<br />
		

</asp:Content>

